import request from "@/utils/request" // axios请求

import type { ILogin, IUserInfo, ILoginParams } from "./model" // 请求返回数据的接口

// 请求数据的接口
enum API {
    LOGIN = "/admin/acl/index/login",
    USERINFO = "/admin/acl/index/info",
    LOGOUT = "/admin/acl/index/logout"
}

// 登录
export const reqLogin = (data: ILoginParams) => request.post<any, ILogin>(API.LOGIN, data)

// 获取用户信息
export const reqUserInfo = () => request.get<any, IUserInfo>(API.USERINFO)

// 退出登录
export const reqLogout = () => request.post<any, any>(API.LOGOUT)